package com.g7.figmaapi.common.exception;

/**
 * @author: taoxiangqian
 * @explain: 错误枚举
 * @since: 2023/10/26 10:28
 */
public enum Errors {
    SUCCESS("0", "success", "成功"),
    SYSTEM_ERROR("11", "system error", "系统错误"),
    SYSTEM_NO_ACCESS_ERROR("12", "system no access", "无权限访问"),
    SYSTEM_NO_AUTH_ERROR("13", "system no auth", "无权限操作"),
    SYSTEM_REQUEST_PARAM_ERROR("14", "system request param error", "请求参数错误"),
    SYSTEM_UPDATE_ERROR("15", "system update fail", "数据更新失败"),
    SYSTEM_INSERT_ERROR("16", "system insert fail", "数据插入失败"),
    SYSTEM_DELETE_ERROR("17", "system delete fail", "数据删除失败"),
    SYSTEM_DATA_ERROR("18", "system data exception", "数据异常"),
    SYSTEM_BUSINESS_ERROR("19", "system business", "系统繁忙,请您稍后再试"),
    SYSTEM_CONFIGURATION_ERROR("20", "system configuration error", "系统配置错误"),
    SYSTEM_HTTP_PARAM_ERROR("21", "system http param error", "HTTP参数错误"),
    SYSTEM_HTTP_RESULT_ERROR("22", "system http result error", "HTTP结果错误"),
    SYSTEM_DATA_CONVERT_ERROR("23", "system data convert error", "数据转换错误"),
    SYSTEM_CALL_INTERFACE_ERROR("24", "system call interface error", "调用接口失败"),
    SYSTEM_DATA_IS_DEL_ERROR("25", "system data is del error", "数据已经删除"),
    SYSTEM_UPDATE_NO_AUTH_ERROR("26", "system update no auth fail", "数据不允许更新"),
    SYSTEM_INSERT_NO_AUTH_ERROR("27", "system insert no auth fail", "数据不允许插入"),
    SYSTEM_DELETE_NO_AUTH_ERROR("28", "system delete no auth fail", "数据不允许删除"),
    SYSTEM_FILE_UPLOAD_FAIL("29", "system file upload fail", "上传文件失败"),
    SYSTEM_FILE_TOO_MAX_FAIL("30", "system file too max fail", "上传文件过大"),
    SYSTEM_FILE_TOO_MIN_FAIL("31", "system file too min fail", "上传文件过小"),
    SYSTEM_FILE_NULL_FAIL("32", "system file null fail", "上传文件为空"),
    SYSTEM_DATA_REPEAT_ERROR("33", "system data repeat error", "数据重复");

    public String code;
    public String exception;
    public String msg;

    private Errors(String code, String exception, String msg) {
        this.code = code;
        this.exception = exception;
        this.msg = msg;
    }

    public static Errors getErrors(String code) {
        Errors result = null;
        Errors[] var2 = values();
        int var3 = var2.length;

        for(int var4 = 0; var4 < var3; ++var4) {
            Errors status = var2[var4];
            if (status.code.equals(code)) {
                result = status;
                break;
            }
        }

        return result;
    }

    public static String getMsg(String code) {
        String result = "";
        Errors[] var2 = values();
        int var3 = var2.length;

        for(int var4 = 0; var4 < var3; ++var4) {
            Errors status = var2[var4];
            if (status.code.equals(code)) {
                result = status.msg;
                break;
            }
        }

        return result;
    }
}
